package com.maojianjie.aimee.webautotest;

import org.openqa.selenium.By;

public class Locator
{
	protected By by;

	public enum Type
	{
		ID, NAME, CLASSNAME, LINKTEXT, XPATH
	}

	public Locator(Type type, String value)
	{
		switch (type)
		{
			case ID:
				by = By.id(value);
				break;
			case NAME:
				by = By.name(value);
				break;
			case CLASSNAME:
				by = By.className(value);
				break;
			case LINKTEXT:
				by = By.linkText(value);
				break;
			case XPATH:
				by = By.xpath(value);
				break;
			default:
				by = null;
		}
	}
}
